<?php
define('SITE_TABLE_PREFIX','');
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'IEC Project',
    'language' => 'vi_vn',
    'sourceLanguage' => 'resource',


    // modules
    'modules' => array(
        'Core' => array(
            //Sub modules
            'modules' => array(
                'auth'
            ),
        ),
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'generatorPaths' => array('Core.extensions.gii.generators'),
            'password' => '12345',
        ),
        'Admin' => array(
        ),
        'User' => array(
        ),
        'Article' => array(),
        'Site' => array(),
        'Product' => array(),
        'Gallery' => array(),
        'Partner' => array(),

    ),

    // preloading 'log' component
    'preload' => array('log', 'core'),

    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'Core.components.*',
        'Site.models.*',
        'User.models.*',
        'Article.models.*',
        'Product.models.*',
        'User.components.*',
        'Partner.models.*',
    ),

    'defaultController' => 'site',

    // application components
    'components' => array(
        'core' => array(
            'class' => 'Core.extensions.FlexiCore',
//            'FrontendRenderer' => false,
        ),
        'user' => array(
            'allowAutoLogin' => true,
        ),
        'authManager' => array(
            'class' => 'FAuthManager',
            'assignmentTable'=>'authassignment',
            'itemTable'=>'authitem',
            'itemChildTable'=>'authitemchild',
        ),
        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=iec',
            'emulatePrepare' => true,
            'enableParamLogging' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),
        'errorHandler' => array(
            'class' => 'Core.extensions.base.FErrorHandler',
            'errorAction' => 'site/error',
        ),
        'urlManager' => array(
            //'class'=>'Cms.extensions.CmsUrlManager',
            'urlFormat' => 'path',
            'showScriptName' => false,
            //'urlSuffix'=>'.html',
            'rules' => array(
                //'<locale>/test-lang.html' => 'site/testLang',
                '<locale>/index.html' => 'site/index',
                '<locale>/contact.html' => 'site/contact',
                '<locale>/article-category/page-<page:\d+>/<id:\d+>-<alias>.html' => 'Article/default/listByCategory',
                '<locale>/article-category/<id:\d+>-<alias>.html' => 'Article/default/listByCategory',
                '<locale>/article/<cat_id:\d+>-<id:\d+>-<alias>.html' => 'Article/default/view',
                '<locale>/product-category/page-<page:\d+>/<id:\d+>-<alias>.html' => 'Product/default/listByCategory',
                '<locale>/product-category/<id:\d+>-<alias>.html' => 'Product/default/listByCategory',
                '<locale>/product/<cat_id:\d+>-<id:\d+>-<alias>.html' => 'Product/default/view',
                '<locale>/document-category/page-<page:\d+>/<id:\d+>-<alias>.html' => 'Site/documents/listByCategory',
                '<locale>/document-category/<id:\d+>-<alias>.html' => 'Site/documents/listByCategory',
                '<locale>/document/<cat_id:\d+>-<id:\d+>-<alias>.html' => 'Site/documents/view',
                '<locale>/products.html' => 'Product/default/index',
                '<locale>/page-<page:\d+>/partners.html' => 'Partner/default/index',
                '<locale>/partners.html' => 'Partner/default/index',
                '<locale>/search.html' => 'site/search',
            ),
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning, trace',
                ),
            ),
        ),
        'cache' => array(
            'class' => 'system.caching.CDbCache',
            'autoCreateCacheTable' => true,
            'connectionID' => 'db',
            'cacheTableName' => 'yii_cache',
        ),
        'mail' => array(
            'class' => 'application.modules.Core.extensions.vendors.mail.YiiMail',
            'transportType' => 'smtp',
            'transportOptions' => array(
                'host' => 'localhost',
                'username' => '',
                'password' => '',
                'port' => 25,
                'encryption' => '',
            ),
            'logging' => true,
            'dryRun' => false
        ),
    ),

    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => require(dirname(__FILE__) . '/params.php'),
);
